package com.spotimage.eosps.wsn;

import javax.xml.namespace.QName;
import org.vast.ows.sps.StatusReport;
import com.spotimage.sps.wsn.SPSNotificationSystem;
import com.spotimage.wsn.ISubscriptionDB;


/**
 * Helper class to send notification messages to client
 * subscribed to the given topic channels of EOSPS.
 * 
 * @author Alexandre Robin <alexandre.robin@spotimage.fr>
 */
public class EOSPSNotificationSystem extends SPSNotificationSystem
{
	private static String EOSPS_NS_URI = "http://www.opengis.net/eosps/2.0";
	public static QName SEGMENT_PLANNED_TOPIC = new QName(EOSPS_NS_URI, "SegmentPlanned", "eosps");
	public static QName SEGMENT_ACQUIRED_TOPIC = new QName(EOSPS_NS_URI, "SegmentAcquired", "eosps");
	public static QName SEGMENT_VALIDATED_TOPIC = new QName(EOSPS_NS_URI, "SegmentValidated", "eosps");
	public static QName SEGMENT_CANCELLED_TOPIC = new QName(EOSPS_NS_URI, "SegmentCancelled", "eosps");
	public static QName SEGMENT_FAILED_TOPIC = new QName(EOSPS_NS_URI, "SegmentFailed", "eosps");
	
	
	public EOSPSNotificationSystem(String endpointURI, ISubscriptionDB subscriptionDB)
	{
		super(endpointURI, subscriptionDB);
	}

	
	public void notifySegmentPlanned(StatusReport report)
	{
		notifySubscribers(SEGMENT_PLANNED_TOPIC, report);
	}
	
	
	public void notifySegmentAcquired(StatusReport report)
	{
		notifySubscribers(SEGMENT_ACQUIRED_TOPIC, report);
	}
	
	
	public void notifySegmentValidated(StatusReport report)
	{
		notifySubscribers(SEGMENT_VALIDATED_TOPIC, report);
	}
	
	
	public void notifySegmentCancelled(StatusReport report)
	{
		notifySubscribers(SEGMENT_CANCELLED_TOPIC, report);
	}
	
	
	public void notifySegmentFailed(StatusReport report)
	{
		notifySubscribers(SEGMENT_FAILED_TOPIC, report);
	}
}
